package com.qfedu.edu.exception;

import com.qfedu.edu.result.ResponseCode;
import lombok.Data;

/**
 * @author xiaobobo
 * @title: BesinessException
 * @projectName cd-fy-2401-third-project-parent
 * @description: 这个是咋们的业务异常(可预期的异常)
 * @date 2024/9/23  14:05
 */
@Data
public class BusinessException extends RuntimeException {
    //状态码
    private Integer code;
    //错误的提示信息
    private String msg;

    public BusinessException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(ResponseCode responseCode) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
    }

}
